<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        
       <div @click="father">
       father
          <h2 @click.stop="children">children</h2>
       </div>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>

  


    let app = new Vue({ //vue 属性
        el: '#app', //选择中的元素=》包括自己和里面的元素可以使用 vue 语法
        data: { //存放数据
            msg: '张三',
            num: 0,
            list: [
                { name: '手机', id: 1, typeList: [{ name: '小米' }, { name: "华为" }] },
                { name: '电视', id: 2 },
                { name: '笔记本', id: 3 },
                { name: '耳机', id: 4 },

            ]

        },
        methods: {
            father(){
             console.log('father');
            } ,
            children(){
                console.log('children');
            }
        }

    })

    // 解决事件冒泡： .stop=>阻止事件冒泡

</script>

</html>